import React, { useState } from "react";

const Lyy = () => {
    const [color, setCololr] = useState("blue");
    const changeColor = () => {
        setCololr(color == 'blue' ? 'red' : 'blue');
    }

    return (
        <>
            <div>刘源小朋友写字很好看</div>
            {/* <div className="lyy">刘源好可爱</div> */}
            <div><button onClick={changeColor}>改变颜色</button></div>
            <style jsx>
                {`
                    div {color:${color}}
                    // .lyy {color: red;}
                `}
            </style>
        </>
    )
}

export default Lyy;